package hanxx.security.domain;
/**
 * @edit:韩鑫鑫
 * @Date: 2022/08/15/11:54
 * @Description:
 */
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "sys_user_role")
@DynamicUpdate
@DynamicInsert
@IdClass(SysUserRole.class)
public class SysUserRole implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    /** 用户ID */
    private Long userId;

    /**
     * 角色ID
     */
    @Id
    private Long roleId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("roleId", getRoleId())
                .toString();
    }
}
